
const api = {
  friend: '',
  group: '',
  qrLogin: '',
  user: '',
  single: '',
  webws: '',
  JINDOUYUNURL: ''
}
const localDomain = '192.168.10.7' // 本地

// const testDomain = '118.195.200.207'
const testDomain = 'im-api.xiaolandouapp.com'
const productionDomain = '###.###.###.###'

switch (process.env.NODE_ENV) {
  // case 'inside': // 内网
  //   api.friend = `http://${localDomain}:8083/api/v1/`
  //   api.group = `http://${localDomain}:8086/`
  //   api.single = `http://${localDomain}:8084/`
  //   api.user = `http://${localDomain}:8081/`
  //   api.qrLogin = `ws://${localDomain}:8001/qrLogin?type=web`
  //   api.webws = `ws://${localDomain}:8010/webws?token=`
  //   api.JINDOUYUNURL = 'https://test-storage-gcp.tcloudapp.com/storage/'
  //   break
  case 'development':
    api.single = `http://${localDomain}:8084/`
    api.friend = `http://${localDomain}:8083/api/v1/`
    api.group = `http://${localDomain}:8086/`
    api.user = `http://${localDomain}:8081/`
    api.qrLogin = `ws://${localDomain}:8001/qrLogin?type=web`
    api.webws = `ws://${localDomain}:8010/webws?token=`
    api.JINDOUYUNURL = 'https://test-storage-gcp.tcloudapp.com/storage/v2/file'
    break
  case 'test':
    api.single = `http://${testDomain}/single/`
    api.friend = `http://${testDomain}/friend/api/v1/`
    api.group = `http://${testDomain}/group/`
    api.user = `http://${testDomain}/user/`
    api.qrLogin = `ws://${testDomain}/qrLogin?type=web`
    api.webws = `ws://${testDomain}/webwsV2?token=`
    // api.JINDOUYUNURL = 'https://test-storage-gcp.tcloudapp.com/storage'
    api.JINDOUYUNURL = 'https://test-storage-gcp.tcloudapp.com/storage/v2/file'
    break
  // case 'development':
  case 'production':
    api.single = `https://${productionDomain}/single/`
    api.friend = `https://${productionDomain}/friend/api/v1/`
    api.group = `https://${productionDomain}/group/`
    api.user = `https://${productionDomain}/user/`
    api.qrLogin = `wss://${productionDomain}/qrLogin?type=web`
    api.webws = `wss://${productionDomain}/webwsV2?token=`
    // api.JINDOUYUNURL = 'https://newfile.aillo.cc/storage/'
    api.JINDOUYUNURL = '*******************'
    break
}

export default api
